<script>
  import MaxBarByMonth from './MaxBarByMonth.vue'
  import {
    getLastYearString,
    getYearDayCount
  } from './utils'
  export default {
    name: 'MaxBarByYear',
    mixins: [MaxBarByMonth],
    data() {
      return {
        chartOption: {
          title: {
            text: this.$t('analysis.MaxPercentByYear'),
            left: 'center'
          },
          tooltip: {
            show: true
          },
          xAxis: [{
            type: 'category'
          }],
          yAxis: [{
            type: 'value',
            show: true
          }],
          series: [{
            name: this.$t('analysis.MaxPercent'),
            type: 'bar'
          }]
        },
        queryTime: {
          label: this.$t('analysis.Year'),
          type: 'year',
          valueFormat: 'yyyy'
        },
      }
    },
    methods: {
      setQueryTime() {
        this.queryParams.time = getLastYearString()
        this.totalDay = getYearDayCount(this.queryParams.time)
      },
      handleDate() {
        this.totalDay = getYearDayCount(this.queryParams.time)
        this.queryPermission()
      },
    }
  }

</script>
